<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateBusinessAoiTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('business_aoi', function (Blueprint $table) {
            $table->id();
            $table->string('name', 32)->default('')->comment('名称');
            $table->string('province', 32)->default('')->comment('省');
            $table->string('city', 32)->default('')->comment('市');
            $table->string('district', 32)->default('')->comment('区');
            $table->unsignedInteger('cityCode')->default(0)->comment('城市code');
            $table->string('level', 12)->default('')->comment('级别');
            $table->string('lng', 12)->default('')->comment('经度');
            $table->string('lat', 12)->default('')->comment('纬度');
            $table->string('fullSpell', 12)->default('')->comment('完整拼写');
            $table->unsignedInteger('dataId')->default(0)->comment('信息ID');
            $table->unsignedInteger('housePrice')->default(0)->comment('房价/平方米');
            $table->json('boundary')->nullable()->comment('边界');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '商圈API信息';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('business_aoi');
    }
}
